package com.ty.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ty.bean.AgentInquirySheet;
import com.ty.common.bean.PageBean;
import com.ty.common.crud.BaseServiceImpl;
import com.ty.mapper.AgentInquirySheetMapper;
import com.ty.query.AgentInquirySheetQuery;
import com.ty.service.AgentInquirySheetInquiryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AgentInquirySheetServiceImpl extends BaseServiceImpl<AgentInquirySheet, AgentInquirySheetMapper> implements AgentInquirySheetInquiryService {

    @Autowired
    AgentInquirySheetMapper sheetMapper;

    @Override
    public PageBean query(AgentInquirySheetQuery query) {
        PageHelper.startPage(query.getPage(),query.getPageSzie() );//紧跟查询
        List list =sheetMapper.queryByMap(query);
        PageInfo pageInfo = new PageInfo(list);
        return new PageBean(query.getPage(), query.getPageSzie(), pageInfo.getTotal(),list);
    }
}
